<table class="xsui-table xsui-table-striped xsui-table-hover xsui-table-bordered" data-xsui-options="multipleSelect:false">
    <thead>
        <tr>
            <th><sohtml:sortlink field="settlement_status" direct="D" param="sort" title="排序" /></th>
            <th>日期</th>
            <th>旅行社</th>
            <th>车牌</th>
            <th>卡号</th>
            <th>人数</th>
            <th>客源地</th>
            <th>客源类型</th>
            <th>讲解厅</th>
            <th>{$store_data['sale_title1']}销售</th>
            <th>{$store_data['sale_title2']}销售</th>
            <th>{$store_data['sale_title3']}销售</th>
            <th>现金金额</th>
            <th>刷卡金额</th>
            <th>总额</th>
            <th>销售类型</th>
            <th>定金日期</th>
            <th>扣单金额</th>
            <th>{$store_data['settlement_title']}</th>
            <th>佣金比例</th>
            <th>讲解员</th>
            <th>讲解业绩</th>
            <th>导游信息</th>
            <th>备注</th>
            <th>录入时间</th>
        </tr>
    </thead>
    <tbody>
    <if condition="sofn_auth('MD_RXSB_XZRXSB')">
        <tr id="form" data-action="{:U('daysales_add_save')}">
            <td class="xsui-nowrap">
                <a href="#" title="保存记录" id="lnk-save">[保存]</a>
                <input type="hidden" name="store_id" value="{$search.store_id}" />
                <input type="hidden" name="site_id" value="{$login_data['site_id']}" />
                <input type="hidden" name="id" value="" />
            </td>
            <td><input type="text" name="time_date" class="datepicker" size="10" placeholder="日期" required="required" value="{:date('Y-m-d')}" /></td>
            <td><select name="travel_agency_id" data-url="{:U('TravelAgencyConf/get_json_list','store_id='.$search['store_id'])}" required="required" title="旅行社"><option>请选择</option></select></td>
            <td><input type="text" name="license_plate_number" size="6" placeholder="车牌" required="required" /></td>
            <td><input type="text" name="card_number" size="4" placeholder="卡号" required="required" /></td>
            <td><input type="text" name="person_count" size="3" placeholder="人数" value="0" required="required" /></td>
            <td><input type="text" name="tourist_origin" size="8" placeholder="客源地" required="required" /></td>
            <td><select name="tourist_type_id" data-url="{:U('TouristTypeConf/get_json_list','store_id='.$search['store_id'])}" required="required" title="客源类型"><option>请选择</option></select></td>
            <td><select name="interpretation_room_id" data-url="{:U('InterpretationRoomConf/get_json_list','store_id='.$search['store_id'])}" required="required" title="讲解厅"><option>请选择</option></select></td>
            <td><input type="text" name="sichou_amount" size="6" placeholder="丝绸销售" value="0" required="required" /></td>
            <td><input type="text" name="sijin_amount" size="6" placeholder="丝巾销售" value="0" required="required" /></td>
            <td><input type="text" name="baihuo_amount" size="6" placeholder="百货销售" value="0" required="required" /></td>
            <td><input type="text" name="cash_amount" size="6" placeholder="现金金额" value="0" required="required" /></td>
            <td><input type="text" name="credit_amount" size="6" placeholder="刷卡金额" value="0" required="required" /></td>
            <td><input type="text" name="product_amount" size="8" placeholder="总额" value="0" readonly="readonly" title="自动计算,禁止编辑!" /></td>
            <td><select name="sale_type" required="required" title="销售类型"><option>请选择</option><option value="现场">现场</option><option value="定金">定金</option></select></td>
            <td><input type="text" name="deposit_date" class="datepicker" size="10" placeholder="定金日期" required="required" /></td>            
            <td><input type="text" name="commission_amount" size="6" placeholder="扣单金额" value="0" required="required" /></td>
            <td><input type="text" name="settlement_amount" size="6" placeholder="结算金额" value="0" required="required" /></td>
            <td><select name="commission_rate_id" data-url="{:U('CommissionRate/get_json_list','travel_id=varid')}" title="佣金比例"><option>请选择</option></select></td>
            <td><select name="interpreter_id" data-url="{:U('InterpreterConf/get_json_list','store_id='.$search['store_id'])}" required="required" title="讲解员"><option>请选择</option></select></td>
            <td><input type="text" name="interpret_performance" size="6" placeholder="讲解业绩" value="0" required="required" /></td>
            <td><select name="guide_id" data-url="{:U('GuideConf/get_json_list','store_id='.$search['store_id'])}" title="导游信息"><option>请选择</option></select></td>
            <td colspan="2"><input type="text" name="remark" placeholder="备注" /></td>
        </tr>    
    </if>
    <foreach name="list" item="vo">
        <tr data-key="{$vo.id}">
            <td class="xsui-nowrap">
        <if condition="$vo['settlement_status'] lt 1">
            <if condition="sofn_auth('MD_RXSB_BJRXSB')">
                <a href="#form" data-url="{:U('get_json_item','id='.$vo['id'])}" class="xsui-lnk-edit" title="编辑" style="font-size:13px;"><i class="fa fa-edit fa-fw"></i></a>
            </if>
            <if condition="sofn_auth('MD_RXSB_SCRXSB')">
                <a href="{:U('item_delete','id='.$vo['id'])}" class="xsui-lnk-remove" data-id="{$vo.id}" title="删除"><i class="fa fa-remove fa-fw"></i></a>
            </if>
            <else/>
            已结算
        </if>
        </td>
        <td>{$vo.time_date}</td>
        <td>{$vo.travel_agency_text}</td>
        <td>{$vo.license_plate_number}</td>
        <td>{$vo.card_number}</td>
        <td>{$vo.person_count}</td>
        <td>{$vo.tourist_origin}</td>
        <td>{$vo.tourist_type_text}</td>
        <td>{$vo.interpretation_room_text}</td>
        <td>{$vo.sichou_amount}</td>
        <td>{$vo.sijin_amount}</td>
        <td>{$vo.baihuo_amount}</td>
        <td>{$vo.cash_amount}</td>
        <td>{$vo.credit_amount}</td>
        <td>{$vo.product_amount}</td>
        <td class="sale_type_cell">{$vo.sale_type}</td>
        <td>{$vo.deposit_date}</td>
        <td>{$vo.commission_amount}</td>
        <td>{$vo.settlement_amount}</td>
        <td class="xsui-nowrap">{$vo.commission_text}</td>
        <td>{$vo.interpreter_text}</td>
        <td>{$vo.interpret_performance}</td>
        <td>{$vo.guide_text}</td>
        <td>{$vo.remark}</td>
        <td class="xsui-nowrap">{$vo.create_time}</td>
        </tr>
    </foreach>
</tbody>
<tfoot>    
    <tr>
        <td colspan="6" style="text-align: right; color:#09C;">数据统计：</td>
        <td title="人数">{$sum.person_count}</td>
        <td colspan="3">&nbsp;</td>
        <td title="丝绸销售">{$sum.sichou_amount}</td>
        <td title="丝巾销售" style="color:#09C">{$sum.sijin_amount}</td>
        <td title="百货销售">{$sum.baihuo_amount}</td>
        <td title="现金金额" style="color:#09C">{$sum.cash_amount}</td>
        <td title="刷卡金额">{$sum.credit_amount}</td>
        <td title="总额" style="color:#09C">{$sum.product_amount}</td>
        <td colspan="2">&nbsp;</td>
        <td title="扣单金额">{$sum.commission_amount}</td>
        <td title="结算金额" style="color:#09C">{$sum.settlement_amount}</td>
        <td colspan="2">&nbsp;</td>
        <td title="讲解业绩">{$sum.interpret_performance}</td>
        <td colspan="3">&nbsp;</td>
    </tr>
</tfoot>
</table>
<div class="xsui-pagination">{$page}</div>